package com.example.springcloud.client;

import com.example.springcloud.pojo.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * FeignClient fallback当PRODUCT-DATA-SERVICE服务不可用时 调用哪个类的方法
 * @author: trtan
 * @date: 2021-06-14 08:31
 **/
@FeignClient(value = "PRODUCT-DATA-SERVICE", fallback = ProductClientFeignHystrix.class)
@Component
public interface ProductClientFeign {

    /**
     * 调用
     * @param
     * @return java.util.List<com.example.springcloud.pojo.Product>
     * @author trtan
     * @date 2021/6/14 9:06
     */
    @GetMapping("/products")
    public List<Product> listProducts();
}
